 <?php
	class page_base {
		private $corps;
		private $page;
		private $page_header = "Tickekting";
		private $small_ph = "";
		
		// Permet d'afficher le contenu de chaque page
		public function __construct($p, $ph, $sph) {
			$this->page = $p;
			$this->page_header = $ph;
			$this->small_ph = $sph;
		}
		
		/**
		 * ****** Gestion des setters ******************
		 */
		public function __set($propriete, $valeur) {
			switch ($propriete) {
				case 'corps' :
					{
						$this->corps = $valeur;
						break;
					}
				case 'titre' :
					{
						$this->titre = $valeur;
						break;
					}
			}
		}
		protected function affiche_contenu() {
			echo $this->corps;
		}
		
		/**
		 * ***********Gestion des styles ********************
		 */
		private function affiche_style() {
			?>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
	content="Service d'administration du logicien Oremia">
<meta name="author" content="Pelletier Jordan">

<!-- bootstrap widget theme -->
<!-- tablesorter plugin -->
<script type="text/javascript" src="styles/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="styles/js/tableSorter.js"></script>
<script src="styles/js/jquery.tablesorter.js"></script>
<script src="js/Lie.js"></script>
<script src="styles/js/jquery.tablesorter.widgets.js"></script>
<script type="text/javascript" src="styles/js/script.js"></script>
<script type="text/javascript" src="styles/js/bootstrap.min.js"></script>
<script type="text/javascript" src="styles/js/bootstrap-tab.js"></script>
<script type="text/javascript" src="styles/js/bootbox.min.js"></script>
<script type="text/javascript" src="js/appeldonnees.js"></script>
<script type="text/javascript" src="js/controleur.js"></script>
<script type="text/javascript" src="js/highcharts.js"></script>
<script type="text/javascript" src="js/graph/GraphAppelTemps.js"></script>
<script type="text/javascript" src="js/graph/GraphProbl.js"></script>
<script type="text/javascript"
	src="styles/js/jquery.simplePagination.js"></script>
<script type="text/javascript" src="js/paginationcustom.js"></script>
<script type="text/javascript" src="js/recherche.js"></script>
<script type="text/javascript" src="styles/js/jquery-ui.js"></script>
    <script src="http://malsup.github.com/jquery.form.js"></script> 

<link rel="shortcut icon" href="styles/favicon.png">
<link href="styles/css/jquery-ui.css" rel="stylesheet">
<link href="styles/css/bootstrap.css" rel="stylesheet">
<link href="styles/css/bootstrap-table.css" rel="stylesheet">
<link rel="stylesheet" href="styles/css/bootstrap.min.css">
<link href="styles/css/style.css" rel="stylesheet">
<link href="styles/css/sb-admin.css" rel="stylesheet">
<link href="styles/css/plugins/morris.css" rel="stylesheet">
<link href="styles/font-awesome/css/font-awesome.min.css"
	rel="stylesheet" type="text/css">

<?php
		}
		
		/**
		 * ************ Affichage du pied de la page **************************
		 */
		private function affiche_footer() {
			?>
<hr>
<i>&copy; 2015 <a href="http://www.zumatec.com/" target="blank">Zumatec</a>,
	tous droits r&eacuteserv&eacutes.
</i>
<?php
		}
		protected function affiche_page_header() {
			?>
<div class="row">
	<div class="col-lg-12">
		<h1 class="page-header"><?php echo $this->page_header?><small><?php echo $this->small_ph?></small>
		</h1>
		<ol class="breadcrumb">
			<li class="active">   <?php 
		$pos = strrpos($_SERVER['REQUEST_URI'], "AccueilConnecter.php");
if ($pos){
	echo '<i class="fa fa-fw fa-home"></i>'.$this->page_header;
}else{
	echo '<a href="AccueilConnecter.php"><i class="fa fa-fw fa-home"></i> Accueil</a> / '.$this->page_header;
		}?>
                            </li>
		</ol>
	</div>
</div>
<?php



		}
		
		/**
		 * ************ Affichage du menu de la page (non connecté)**************************
		 */
		protected function affiche_menu() {
			?>

<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
	<div class="navbar-inner">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle" data-toggle="collapse"
				data-target=".navbar-ex1-collapse">
				<span class="sr-only">Toggle navigation</span>
			</button>
			<a class="navbar-brand" href="connexion.php"><i><img class="icone"
					src="styles/oremia.ico"></i>Serveur de ticketing</a>
		</div>
		<div class="container">

			<div class="collapse navbar-collapse navbar-ex1-collapse">
				<ul class="nav navbar-nav side-nav">
					<li><a href="index.php"><i class="fa fa-fw fa-home"></i> Accueil</a>
					</li>
					<li><a href="connexion.php"><i class="fa fa-sign-in"></i> Connexion</a>
					</li>
				</ul>
			</div>
			<!--/.nav-collapse -->
		</div>
	</div>
</div>
<?php
		}
		
		/**
		 * ****************** Fonction permettant l'affichage de la page *************
		 */
		public function affiche() {
			?>
<!DOCCTYPE html>
<html lang='fr'>
<head>
<title>Ticketing</title>
<meta charset="utf-8" />
				<?php
			$this->affiche_style ();
			?>
			</head>
<body>
	<div id="wrapper">
				<?php
			$this->affiche_menu ();
			?>
			 <div id="page-wrapper">

			<div class="container-fluid">

				<!-- Page Heading -->
			<?php
			$this->affiche_page_header ();
			$this->affiche_contenu ();
			?>
		</div>
		</div>

</body>

</html>

<?php
		}
	}
	?>